﻿<Window
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:local="clr-namespace:FolderSize.WPF"
   x:Class="FolderSize.WPF.MainForm"
   Title="{Binding ElementName=FolderTreeView,Path=ProgressInfo}"
   Closed="Window_Closed" 
   Loaded="Window_Loaded"
   MinWidth="600" 
   MinHeight="400" 
   WindowStyle="SingleBorderWindow" 
   Background="Transparent">
   <Window.Resources>
      <Storyboard x:Key="InitialWaitStoryboard" Duration="00:00:01" Completed="Storyboard_Completed" />

      <Storyboard x:Key="IdlingStoryboard" Duration="00:00:05" Completed="Storyboard_Completed" />
      
      <Storyboard x:Key="PresentInfoBlockStoryboard" Completed="Storyboard_Completed">
         <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InfoBubbleTranslation" Storyboard.TargetProperty="Y">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="400" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.30" Value="200" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.80" Value="0" />
         </DoubleAnimationUsingKeyFrames>
         <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InfoBubble" Storyboard.TargetProperty="Opacity">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.80" Value="1" />
         </DoubleAnimationUsingKeyFrames>
      </Storyboard>
      
      <Storyboard x:Key="HideInfoBlockStoryboard" Completed="Storyboard_Completed">
         <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InfoBubbleTranslation" Storyboard.TargetProperty="Y">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.30" Value="200" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.80" Value="400" />
         </DoubleAnimationUsingKeyFrames>
         <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InfoBubble" Storyboard.TargetProperty="Opacity">
            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
            <SplineDoubleKeyFrame KeyTime="00:00:00.80" Value="0" />
         </DoubleAnimationUsingKeyFrames>
      </Storyboard>
      
   </Window.Resources>
   <Window.Triggers>
      <EventTrigger RoutedEvent="Window.Loaded">
         <BeginStoryboard Storyboard="{StaticResource InitialWaitStoryboard}" />
      </EventTrigger>
   </Window.Triggers>
   <Grid>
      <TextBlock 
         HorizontalAlignment="Left" 
         Margin="8,0,0,12" 
         VerticalAlignment="Bottom" 
         Width="32" 
         Height="17" 
         Text="Path:">
         <TextBlock.BitmapEffect>
            <OuterGlowBitmapEffect GlowColor="#FFFFFFFF" GlowSize="6"/>
         </TextBlock.BitmapEffect>
      </TextBlock>

      <TextBox 
         Margin="44,0,254,8" 
         VerticalAlignment="Bottom" 
         Height="27" 
         Text="{Binding ElementName=FolderTreeView,Path=Path,UpdateSourceTrigger=PropertyChanged}" 
         />

      <ComboBox 
         HorizontalAlignment="Right" 
         Margin="0,0,172,8" 
         VerticalAlignment="Bottom" 
         Width="78" 
         Height="27" 
         IsSynchronizedWithCurrentItem="True" 
         SelectedIndex="0"  
         ItemsSource="{Binding Path=DisplayModes,ElementName=FolderTreeView,Mode=OneWay}" 
         SelectedValue="{Binding Path=DisplayMode,ElementName=FolderTreeView}"
         />
      <Button 
         Height="27" 
         Content="_Stop" 
         Margin="0,0,90,8" 
         VerticalAlignment="Bottom" 
         HorizontalAlignment="Right" 
         Width="78" 
         Command="{Binding ElementName=FolderTreeView,Path=StopCommand}"
         />
      <Button 
         HorizontalAlignment="Right" 
         Margin="0,0,8,8" 
         VerticalAlignment="Bottom" 
         Width="78" 
         Height="27" 
         Content="_Go" 
         IsDefault="True"  
         Command="{Binding ElementName=FolderTreeView,Path=GoCommand}"
         x:Name="GoButton"
         Click="GoButton_Click"
         />

      <local:FolderTree 
         Margin="8,8,8,41" 
         x:Name="FolderTreeView"
         />
      
      <local:BubbleContentControl 
         IsHitTestVisible="False"
         x:Name="InfoBubble"
         HorizontalAlignment="Right" 
         VerticalAlignment="Bottom" 
         Margin="0,0,40,40" 
         Height="300"
         MinWidth="400"
         >
         <local:BubbleContentControl.RenderTransform>
            <TranslateTransform x:Name="InfoBubbleTranslation" Y="400"/>
         </local:BubbleContentControl.RenderTransform>
         <Grid>
            <TextBlock
               x:Name="InitialInfoText"
               HorizontalAlignment="Center"
               VerticalAlignment="Center"
               FontSize="36"
               Foreground="White"
            >
            Click to scan disk
            </TextBlock>
            <TextBlock
               x:Name="HintInfoText"
               Visibility="Collapsed"
               HorizontalAlignment="Center"
               VerticalAlignment="Center"
               FontSize="24"
               Foreground="White"
            >
               <Run>Click for path</Run>
               <LineBreak/>
               <Run>drag to move</Run>
               <LineBreak/>
               <Run>mouse wheel zooms</Run>
               <LineBreak/>
               <Run>double click to explore</Run>
               <LineBreak/>
               <Run>right click resets position</Run>
            </TextBlock>
         </Grid>
      </local:BubbleContentControl>
   </Grid>
</Window>